home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-admin / options-misc.php < prev    next >
Encoding:
PHP Script  |  2004-05-08  |  5.1 KB  |  132 lines

  1. <?php
  2. require_once('../wp-includes/wp-l10n.php');
  3.  
  4. $title = 'Miscellaneous Options';
  5. $parent_file = 'options-general.php';
  6.  
  7. function add_magic_quotes($array) {
  8.     foreach ($array as $k => $v) {
  9.         if (is_array($v)) {
  10.             $array[$k] = add_magic_quotes($v);
  11.         } else {
  12.             $array[$k] = addslashes($v);
  13.         }
  14.     }
  15.     return $array;
  16. }
  17.  
  18. if (!get_magic_quotes_gpc()) {
  19.     $_GET    = add_magic_quotes($_GET);
  20.     $_POST   = add_magic_quotes($_POST);
  21.     $_COOKIE = add_magic_quotes($_COOKIE);
  22. }
  23.  
  24. $wpvarstoreset = array('action','standalone', 'option_group_id');
  25. for ($i=0; $i<count($wpvarstoreset); $i += 1) {
  26.     $wpvar = $wpvarstoreset[$i];
  27.     if (!isset($$wpvar)) {
  28.         if (empty($_POST["$wpvar"])) {
  29.             if (empty($_GET["$wpvar"])) {
  30.                 $$wpvar = '';
  31.             } else {
  32.                 $$wpvar = $_GET["$wpvar"];
  33.             }
  34.         } else {
  35.             $$wpvar = $_POST["$wpvar"];
  36.         }
  37.     }
  38. }
  39.  
  40.  
  41. $standalone = 0;
  42. include_once('admin-header.php');
  43. include('options-head.php');
  44. ?>
  45.  
  46. <div class="wrap"> 
  47.   <h2><?php _e('Miscellaneous Options') ?></h2> 
  48.   <form name="form1" method="post" action="options.php"> 
  49.     <input type="hidden" name="action" value="update" /> 
  50.     <input type="hidden" name="action" value="update" />         <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','default_geourl_lat','default_geourl_lon','use_default_geourl'" /> 
  51. <fieldset class="options">
  52. <legend>
  53. <input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />
  54. <label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend>
  55.     <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  56.       <tr> 
  57.         <th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th> 
  58.         <td>
  59.             <input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php echo get_settings('fileupload_realpath'); ?>" size="50" /><br />
  60. <?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?>
  61.   
  62.             </td> 
  63.       </tr> 
  64.       <tr>
  65.         <th valign="top" scope="row"><?php _e('URI of this directory:') ?> </th>
  66.         <td>          
  67.             <input name="fileupload_url" type="text" id="fileupload_url" value="<?php echo get_settings('fileupload_url'); ?>" size="50" /><br />
  68. <?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?>
  69.         </td>
  70.       </tr>
  71.       <tr>
  72.         <th scope="row"><?php _e('Maximum size:') ?> </th>
  73.           <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_settings('fileupload_maxk'); ?>" size="4"> 
  74.         <?php _e('Kilobytes (KB)') ?></td>
  75.           </tr>
  76.       <tr>
  77.         <th valign="top" scope="row"><?php _e('Allowed file extensions:') ?></th>
  78.           <td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php echo get_settings('fileupload_allowedtypes'); ?>" size="40">
  79.               <br>
  80.          <?php _e('Recommended: <code>jpg jpeg png gif </code>') ?></td>
  81.           </tr>
  82.       <tr>
  83.         <th scope="row"><?php _e('Minimum level to upload:') ?></th>
  84.           <td><select name="fileupload_minlevel" id="fileupload_minlevel">
  85. <?php
  86. for ($i = 1; $i < 11; $i++) {
  87. if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'";
  88. else $selected = '';
  89.     echo "\n\t<option value='$i' $selected>$i</option>";
  90. }
  91. ?>
  92.               </select></td>
  93.           </tr>
  94.     </table> 
  95. </fieldset>
  96. <fieldset class="options">
  97. <legend>
  98. <input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> />
  99. <label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend>
  100.     <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  101.       <tr> 
  102.         <th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th> 
  103.         <td>
  104.             <input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php echo get_settings('default_geourl_lat'); ?>" size="50" />
  105.             </td> 
  106.       </tr> 
  107.       <tr>
  108.         <th valign="top" scope="row"><?php _e('Default longitude:') ?> </th>
  109.         <td>          
  110.             <input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php echo get_settings('default_geourl_lon'); ?>" size="50" />
  111.         </td>
  112.       </tr>
  113.       <tr>
  114.         <th scope="row">  </th>
  115.           <td><label>
  116.             <input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> /> 
  117.             <?php _e('Use default location values if none specified.') ?></label></td>
  118.           </tr>
  119.  
  120.     </table> 
  121. </fieldset>
  122.         <p>
  123.             <label>
  124.             <input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> 
  125.             <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label>
  126.         </p>
  127.     <p class="submit">
  128.       <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
  129.     </p>
  130.   </form> 
  131. </div> 
  132. <?php include("admin-footer.php") ?>